const http = require('http')
const fs = require('fs')

http.createServer((req, res) => {
  const readStream = fs.createReadStream('./static/example.txt')
  // 设置响应头，状态码为200，指定内容类型为text/html
  res.writeHead(200, { 'Content-type': 'text/html' })
  readStream.pipe(res)
}).listen(6435)